<!DOCTYPE html>
<html lang="zh-CN">
  <head><meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>


<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />

<meta name="theme-color" content="#f8f5ec" />
<meta name="msapplication-navbutton-color" content="#f8f5ec">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="#f8f5ec">

<meta name="description" content="创建快捷启动"/><link rel="alternate" href="/default" title="Hexo" ><link rel="shortcut icon" type="image/x-icon" href="/favicon.ico?v=2.11.1" />
<link rel="canonical" href="https://y_kvm.gitee.io/2022/02/21/创建快捷启动/"/>

<link rel="stylesheet" type="text/css" href="/lib/fancybox/jquery.fancybox.css" /><script type="text/x-mathjax-config">
    MathJax.Hub.Config({ tex2jax: { inlineMath: [['$','$'], ['\\(','\\)']] } });
  </script>
  <script type="text/javascript" async src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-MML-AM_CHTML"></script>
<link rel="stylesheet" type="text/css" href="/css/style.css?v=2.11.1" />

<script id="baidu_analytics">
    var _hmt = _hmt || [];
    (function() {
      var hm = document.createElement("script");
      hm.src = "https://hm.baidu.com/hm.js?9c3376609b4eb87c460cc9503d43f10e";
      var s = document.getElementsByTagName("script")[0];
      s.parentNode.insertBefore(hm, s);
    })();
  </script><script src="//cdn1.lncld.net/static/js/3.1.1/av-min.js"></script>
  <script id="leancloud">
    AV.init({
      appId: "mhfJYrvbNrJ7wa3pFNWptaoe-MdYXbMMI",
      appKey: "IDppcTL9Rek0zfezfOeuICaF"
    });
  </script><script>
  window.config = {"leancloud":{"app_id":"mhfJYrvbNrJ7wa3pFNWptaoe-MdYXbMMI","app_key":"IDppcTL9Rek0zfezfOeuICaF"},"toc":true,"fancybox":true,"pjax":"","latex":true};
</script>

    <title>创建快捷启动 - Hexo</title>
  <meta name="generator" content="Hexo 5.4.1"></head>

  <body><div id="mobile-navbar" class="mobile-navbar">
  <div class="mobile-header-logo">
    <a href="/." class="logo">Hexo</a>
  </div>
  <div class="mobile-navbar-icon">
    <span></span>
    <span></span>
    <span></span>
  </div>
</div>

<nav id="mobile-menu" class="mobile-menu slideout-menu">
  <ul class="mobile-menu-list"><a href="/">
        <li class="mobile-menu-item">首页
          </li>
      </a><a href="/tags/">
        <li class="mobile-menu-item">标签
          </li>
      </a><a href="/about/">
        <li class="mobile-menu-item">关于
          </li>
      </a></ul>
</nav>
<div class="container" id="mobile-panel">
      <header id="header" class="header"><div class="logo-wrapper">
  <a href="/." class="logo">Hexo</a>
</div>

<nav class="site-navbar"><ul id="menu" class="menu"><li class="menu-item">
          <a class="menu-item-link" href="/">
            首页
            </a>
        </li>
      <li class="menu-item">
          <a class="menu-item-link" href="/tags/">
            标签
            </a>
        </li>
      <li class="menu-item">
          <a class="menu-item-link" href="/about/">
            关于
            </a>
        </li>
      </ul></nav>
</header>

      <main id="main" class="main">
        <div class="content-wrapper">
          <div id="content" class="content"><article class="post">
    <header class="post-header">
      <h1 class="post-title">创建快捷启动
        </h1>

      <div class="post-meta">
        <span class="post-time">
          2022-02-21
        </span><span class="post-visits"
             data-url="/2022/02/21/%E5%88%9B%E5%BB%BA%E5%BF%AB%E6%8D%B7%E5%90%AF%E5%8A%A8/"
             data-title="创建快捷启动">
          阅读次数 0
        </span>
        </div>
    </header>

    <div class="post-toc" id="post-toc">
    <h2 class="post-toc-title">文章目录</h2>
    <div class="post-toc-content">
      <ol class="toc"><li class="toc-item toc-level-2"><a class="toc-link" href="#%E5%88%9B%E5%BB%BA-desktop%E6%96%87%E4%BB%B6"><span class="toc-text">创建*.desktop文件</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E7%BC%96%E5%86%99%E5%BF%AB%E6%8D%B7%E5%90%AF%E5%8A%A8%E5%86%85%E5%AE%B9"><span class="toc-text">编写快捷启动内容</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E6%B7%BB%E5%8A%A0%E5%9B%BE%E6%A0%87"><span class="toc-text">添加图标</span></a></li></ol>
    </div>
  </div><div class="post-content"><h2 id="创建-desktop文件"><a href="#创建-desktop文件" class="headerlink" title="创建*.desktop文件"></a>创建*.desktop文件</h2><p>在位于/usr/share/applications文件夹下创建*.desktop文件</p>
<p>部分软件于~/.local/share/applications </p>
<p>snap系列软件位于/var/lib/snapd/desktop/applications文件夹下</p>
<p>可以参考如下示例</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">sudo <span class="built_in">touch</span> /usr/share/applications/visualstudiocode.desktop</span><br><span class="line">sudo nano /usr/share/applications/visualstudiocode.desktop</span><br><span class="line"></span><br></pre></td></tr></table></figure>



<h2 id="编写快捷启动内容"><a href="#编写快捷启动内容" class="headerlink" title="编写快捷启动内容"></a>编写快捷启动内容</h2><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br></pre></td><td class="code"><pre><span class="line">[Desktop Entry]</span><br><span class="line"><span class="comment">#快捷启动项名称</span></span><br><span class="line">Name=Visual Studio Code			</span><br><span class="line"><span class="comment">#应用简介</span></span><br><span class="line">Comment=Multi-platform code editor <span class="keyword">for</span> linux</span><br><span class="line"><span class="comment">#应用的可执行位置，采用绝对路径</span></span><br><span class="line">Exec=/opt/VSCode-linux-x64/code</span><br><span class="line"><span class="comment">#应用采用的图标</span></span><br><span class="line">Icon=/usr/share/icons/code.png</span><br><span class="line"><span class="comment">#关键字&quot;Type&quot;定义了Desktop Entry文件的类型。常见的&quot;Type&quot;数值是&quot;Application&quot;和&quot;Link&quot;。&quot;Type = Application&quot;表示当前Desktop Entry文件指向了一个应用程序；而&quot;Type = Link&quot;表示当前Desktop Entry文件指向了一个URL (Uniform Resource Locator)。</span></span><br><span class="line">Type=Application</span><br><span class="line"><span class="comment">#启动时是否新建一个任务栏状态</span></span><br><span class="line">StartupNotify=<span class="literal">true</span></span><br><span class="line"><span class="comment">#应用类别分类</span></span><br><span class="line">Categories=TextEditor;Development;Utility;</span><br><span class="line">MimeType=text/plain;</span><br><span class="line"></span><br></pre></td></tr></table></figure>

<p>常见MIME类型</p>
<ul>
<li>超文本标记语言文本 .html,.html text/html </li>
<li>普通文本 .txt text/plain </li>
<li>RTF文本 .rtf application/rtf </li>
<li>GIF图形 .gif image/gif </li>
<li>JPEG图形 .ipeg,.jpg image/jpeg </li>
<li>au声音文件 .au audio/basic </li>
<li>MIDI音乐文件 mid,.midi audio/midi,audio/x-midi </li>
<li>RealAudio音乐文件 .ra, .ram audio/x-pn-realaudio </li>
<li>MPEG文件 .mpg,.mpeg video/mpeg </li>
<li>AVI文件 .avi video/x-msvideo </li>
<li>GZIP文件 .gz application/x-gzip </li>
<li>TAR文件 .tar application/x-tar </li>
</ul>
<h2 id="添加图标"><a href="#添加图标" class="headerlink" title="添加图标"></a>添加图标</h2><p>向/usr/share/icons/文件夹添加上述快捷启动项的图标，并保持名称一致</p>
<p><a target="_blank" rel="noopener" href="https://www.uc23.net/jiaocheng/71395.html">快捷方式原理 - Desktop Entry 文件 - Deepin深度系统用户手册</a></p>

      </div>
      <div class="post-copyright">
    <p class="copyright-item">
      <span>原文作者: </span>
      <a href="https://y_kvm.gitee.io">Explorer</a>
    </p>
    <p class="copyright-item">
      <span>原文链接: </span>
      <a href="https://y_kvm.gitee.io/2022/02/21/%E5%88%9B%E5%BB%BA%E5%BF%AB%E6%8D%B7%E5%90%AF%E5%8A%A8/">https://y_kvm.gitee.io/2022/02/21/%E5%88%9B%E5%BB%BA%E5%BF%AB%E6%8D%B7%E5%90%AF%E5%8A%A8/</a>
    </p>
    <p class="copyright-item">
      <span>许可协议: </span><a rel="license" href="http://creativecommons.org/licenses/by-nc/4.0/" target="_blank">知识共享署名-非商业性使用 4.0 国际许可协议</a>
    </p>
  </div>
      <footer class="post-footer">
        
        <nav class="post-nav"><a class="prev" href="/2022/02/21/Typora%20%E6%90%AD%E9%85%8Dgitee%E5%AE%9E%E7%8E%B0%E4%B8%AA%E4%BA%BA%E5%9B%BE%E5%BA%8A/">
        <i class="iconfont icon-left"></i>
        <span class="prev-text nav-default">Typora 搭配gitee实现个人图床</span>
        <span class="prev-text nav-mobile">上一篇</span>
      </a>
    <a class="next" href="/2022/02/21/Trilium%20API%E4%BA%8C%E6%AC%A1%E5%BC%80%E5%8F%91/">
        <span class="next-text nav-default">Trilium API二次开发</span>
        <span class="prev-text nav-mobile">下一篇</span>
        <i class="iconfont icon-right"></i>
      </a>
    </nav></footer>
    </article></div><div class="comments" id="comments"></div></div>
      </main>

      <footer id="footer" class="footer"><div class="social-links"><a href="mailto:alternatingcurrenttesla@outlook.com" class="iconfont icon-email" title="email"></a>
        <a target="_blank" rel="noopener" href="https://github.com/KVM-Explorer" class="iconfont icon-github" title="github"></a>
        <a href="/atom.xml" class="iconfont icon-rss" title="rss"></a>
    </div><div class="copyright">
  <span class="power-by">
    由 <a class="hexo-link" target="_blank" rel="noopener" href="https://hexo.io/">Hexo</a> 强力驱动
  </span>
  <span class="division">|</span>
  <span class="theme-info">
    主题 - 
    <a class="theme-link" target="_blank" rel="noopener" href="https://github.com/ahonn/hexo-theme-even">Even</a>
  </span>

  <span class="copyright-year">&copy;2015 - 2022<span class="heart">
      <i class="iconfont icon-heart"></i>
    </span>
    <span class="author">Explorer</span>
  </span>
</div>
</footer>

      <div class="back-to-top" id="back-to-top">
        <i class="iconfont icon-up"></i>
      </div>
    </div><script type="text/javascript" src="/lib/jquery/jquery.min.js"></script>
  <script type="text/javascript" src="/lib/slideout/slideout.js"></script>
  <script type="text/javascript" src="/lib/fancybox/jquery.fancybox.pack.js"></script>
  <script type="text/javascript" src="/js/src/even.js?v=2.11.1"></script>
</body>
</html>
